import 'package:flutter/material.dart';
import 'package:flutter_app/components/topAndBottom.dart';

class MineMsgCom extends StatelessWidget{
  List tabList = [
    {"score":"1111","name":"其他"},
    {"score":"2222","name":"其他"},
    {"score":"4444","name":"其他"},
  ];
  List<Widget> buildTAB(){
    List<Widget> listTABWidget = [];
      for(var item in tabList){
        listTABWidget.add(TopAndBottom(item['score'],item['name']));
      }
      return listTABWidget;
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return
          Container(
              child: Container(
                  margin: EdgeInsetsDirectional.fromSTEB(20,0,20,0),
                  padding:EdgeInsetsDirectional.fromSTEB(20,20,20,20) ,
//                  alignment: Alignment(-1,-1),
                  decoration: BoxDecoration(
                      color: Color.fromRGBO(0, 0, 0, 0.5),
                      borderRadius: BorderRadius.circular(10)
                  ),
                  child: Column(
                    children: <Widget>[
                      Container(
                        margin:EdgeInsetsDirectional.fromSTEB(0,0,0,20),
                        child: Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: <Widget>[
                            ClipOval(
                              child: Image.network(
                                'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1576832202&di=e98bdda757ba0a226fa7b17a704396a6&imgtype=jpg&er=1&src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180801%2F21%2F1533130354-tcjsiIBbEW.png',
                                width: 50,
                                height: 50,
                              ) ,
                            ),
                            SizedBox(
                              width: 10.0,
                            ),
                            Row(
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: <Widget>[
                                Text('原住居民',
                                  style: TextStyle(
                                      fontWeight: FontWeight.bold,
                                      color: Colors.white,
                                      fontSize: 18
                                  ),
                                )
                              ],
                            ),
                          ],
                        ) ,
                      ),
                      Flex(
                        direction: Axis.horizontal,
                        children:buildTAB(),
                      )
                    ],
                  )
              )
          );
  }

}